// JavaScript Document
function couleur(obj)
 {
     obj.style.backgroundColor = "#FFFFFF";
 }

function cacheTout()
{
	document.getElementById('err-nom').style.display = "none";
	document.getElementById('err-prenom').style.display = "none";
	document.getElementById('err-mail').style.display = "none";
	document.getElementById('err-pwd').style.display = "none";
	document.getElementById('err-pwd1').style.display = "none";
	document.getElementById('err-pwd2').style.display = "none";
	document.getElementById('err-titre').style.display = "none";
    document.getElementById('err-date').style.display = "none";
	//document.getElementById('err-ville').style.display = "none";
	document.getElementById('err-mail').style.display = "none";
	document.getElementById('err-optin').style.display = "none";
	document.getElementById('err-optin2').style.display = "none";
	document.getElementById('err-cgv').style.display = "none";
}

function check()
{
	cacheTout();
	if (document.getElementById('titre').checked==false && document.getElementById('titre2').checked==false)
	{
		document.getElementById('err-titre').style.display = "block";
		return(false);
	}
    else if(document.getElementById('date-jour').value == '') {
        document.getElementById('err-date').style.display = "block";
		return(false);
    }
	else if (document.getElementById('nom').value == '')
	{
		document.getElementById('err-nom').style.display = "block";
		return(false);
	}
	else if (document.getElementById('prenom').value == '')
	{
		document.getElementById('err-prenom').style.display = "block";
		return(false);
    }
	/*else if(document.getElementById('ville').value == '')
	{
		//document.getElementById('err-ville').style.display = "block";
		//return(false);
	}*/
	else if(document.getElementById("date-jour").value == '') {
		document.getElementById('err-date').style.display = "block";
        return(false);
    }
    else if (document.getElementById('mail').value == '')
	{
		document.getElementById('err-mail').style.display = "block";
		return(false);
	}
	else if (document.getElementById('mail2').value == '')
	{
		document.getElementById('err-mail2').style.display = "block";
		return(false);
	}
	else if (document.getElementById('pwd_1').value == '')
	{
		document.getElementById('err-pwd1').style.display = "block";
		return(false);
	}
	else if (document.getElementById('pwd_2').value == '')
	{
		document.getElementById('err-pwd2').style.display = "block";
		return(false);
	}else if (document.getElementById('pwd_2').value != document.getElementById('pwd_1').value)
	{
		document.getElementById('err-pwd').style.display = "block";
		return(false);
	}
	else if (!(document.getElementById('optinO').checked) && !(document.getElementById('optinN').checked))
	{
		document.getElementById('err-optin').style.display = "block";
		return(false);
	}
	else if (!(document.getElementById('optin2O').checked) && !(document.getElementById('optin2N').checked))
	{
		document.getElementById('err-optin2').style.display = "block";
		return(false);
	}
	else if (document.getElementById('cgv').checked == false)
	{
		document.getElementById('err-cgv').style.display = "block";
		return(false);
	}
	else
		return(true);
}

